package com.godme.config;


import com.godme.prop.JedisClusterProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.JedisCluster;

@Configuration
public class JedisClusterConfig {

    @Autowired
    JedisClusterProperties jedisClusterProperties;

    @Bean
    public JedisCluster jedisCluster(){
        return new JedisCluster(jedisClusterProperties.getHostAndPorts(), jedisClusterProperties.getTimeout());
    }
}
